package com.rush.manageepac.controller;

import com.rush.manageepac.entity.CommunityPeople;
import com.rush.manageepac.entity.Xiaoqu;
import com.rush.manageepac.service.intf.CommunityPeopleService;
import com.rush.manageepac.service.intf.XiaoquService;
import com.rush.manageepac.vo.PageBean;
import com.rush.manageepac.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 于zH
 * @data 2022/8/29 9:04
 */
@RestController
@RequestMapping("/api/xiaoqu/")
public class XiaoquController {
    @Autowired
    private XiaoquService service;

    //新增
    @PostMapping("save.do")
    public R save(Xiaoqu xiaoqu){
        return service.save(xiaoqu);
    }
    //修改
    @PostMapping("update.do")
    public R update(Xiaoqu xiaoqu){
        return service.update(xiaoqu);
    }
    //删除
    @GetMapping("delete.do")
    public R del(int id){
        return service.delete(id);
    }
    //查询
    @GetMapping("selectPage.do")
    public PageBean page(String name, int page, int limit){
        return service.selectPage(name, page, limit);
    }
}